#include <unistd.h>
#include "ResponseQueue.h"

ResponseQueue::ResponseQueue(char* file, char character) : queue(file, character) {
}

ResponseQueue::~ResponseQueue() {
}

int ResponseQueue::Send(long mtype, ResponseMessage responseMessage) {
	return this->queue.write(mtype, responseMessage);
}

int ResponseQueue::Receive(ResponseMessage& responseMessage) {
	long mtype = getpid();

	int result = this->queue.read(mtype, responseMessage);

	return result;
}

void ResponseQueue::destroy() {
	this->queue.destroy();
}
